package com.hpeu_12.app;

import java.util.Scanner;

/**
 * 家庭收支结账软件
 * @author Administrator
 *
 */
public class App01 {

	public static void main(String[] args) {
		
		System.out.println("----------家庭收支结账软件----------");
		System.out.println("1 收支明细");
		System.out.println("2 登记收入");
		System.out.println("3 登记支出");
		System.out.print("请选择(1-4): ");
		Scanner scanner = new Scanner(System.in);
		String i = scanner.next();
		boolean flag=true;
		int balance = 10000;
		do{
			System.out.println("----------家庭收支结账软件----------");
			System.out.println("1 收支明细");
			System.out.println("2 登记收入");
			System.out.println("3 登记支出");
			System.out.println("请选择(1-4): ");
			switch (i) {
			case "1":
				
				break;
			case "2":
				System.out.print("本次收入金额: ");
				int income = scanner.nextInt();
				balance += income;
				System.out.print("本次收入说明: ");
				String instructions = scanner.next();
				break;
			case "3":
				System.out.print("本次支出金额: ");
				int spending = scanner.nextInt();
				balance += spending;
				System.out.print("本次支出说明: ");
				String instructions1 = scanner.next();
				break;
			case "4":
				System.out.println("请输入Y/N确认是否退出");
				String c = scanner.next();
				if (c=="Y") {
					flag=false;
				}
				break;
			}
		}while(flag);
		


	}

}
